{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "\n",
    "from tensorflow.keras.datasets import mnist, cifar10, cifar100\n",
    "\n",
    "from tensorflow.keras import Sequential\n",
    "from tensorflow.keras.callbacks import LambdaCallback\n",
    "from tensorflow.keras.layers import Conv2D, MaxPooling2D, Dropout, Dense, Flatten, Activation\n",
    "\n",
    "import numpy as np\n",
    "import random\n",
    "\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2.0.0-rc1'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# This should print something along the lines of '2.0.0-rc1'\n",
    "tf.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "(x_train, y_train), (x_test, y_test) = mnist.load_data()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Cifar100\n",
    "# labels = ['apple', 'aquarium_fish', 'baby', 'bear', 'beaver', 'bed', 'bee', 'beetle',\n",
    "#                 'bicycle', 'bottle', 'bowl', 'boy', 'bridge', 'bus', 'butterfly', 'camel',\n",
    "#                 'can', 'castle', 'caterpillar', 'cattle', 'chair', 'chimpanzee', 'clock',\n",
    "#                 'cloud', 'cockroach', 'couch', 'crab', 'crocodile', 'cup', 'dinosaur',\n",
    "#                 'dolphin', 'elephant', 'flatfish', 'forest', 'fox', 'girl', 'hamster',\n",
    "#                 'house', 'kangaroo', 'keyboard', 'lamp', 'lawn_mower', 'leopard', 'lion',\n",
    "#                 'lizard', 'lobster', 'man', 'maple_tree', 'motorcycle', 'mountain', 'mouse',\n",
    "#                 'mushroom', 'oak_tree', 'orange', 'orchid', 'otter', 'palm_tree', 'pear',\n",
    "#                 'pickup_truck', 'pine_tree', 'plain', 'plate', 'poppy', 'porcupine',\n",
    "#                 'possum', 'rabbit', 'raccoon', 'ray', 'road', 'rocket', 'rose',\n",
    "#                 'sea', 'seal', 'shark', 'shrew', 'skunk', 'skyscraper', 'snail', 'snake',\n",
    "#                 'spider', 'squirrel', 'streetcar', 'sunflower', 'sweet_pepper', 'table',\n",
    "#                 'tank', 'telephone', 'television', 'tiger', 'tractor', 'train', 'trout',\n",
    "#                 'tulip', 'turtle', 'wardrobe', 'whale', 'willow_tree', 'wolf', 'woman',\n",
    "#                 'worm']\n",
    "\n",
    "# Cifar10\n",
    "# labels = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']\n",
    "\n",
    "# MNIST\n",
    "labels = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Data shapes (10000, 28, 28, 1) (10000, 10) (60000, 28, 28, 1) (60000, 10)\n"
     ]
    }
   ],
   "source": [
    "# Pre-process data\n",
    "img_rows, img_cols, channels = 28, 28, 1 # 32, 32, 3\n",
    "num_classes = 10\n",
    "\n",
    "x_train = x_train / 255\n",
    "x_test = x_test / 255\n",
    "\n",
    "x_train = x_train.reshape((-1, img_rows, img_cols, channels))\n",
    "x_test = x_test.reshape((-1, img_rows, img_cols, channels))\n",
    "\n",
    "y_train = tf.keras.utils.to_categorical(y_train, num_classes)\n",
    "y_test = tf.keras.utils.to_categorical(y_test, num_classes)\n",
    "\n",
    "print(\"Data shapes\", x_test.shape, y_test.shape, x_train.shape, y_train.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Create model\n",
    "def create_model():\n",
    "    model = Sequential()\n",
    "    model.add(Conv2D(32, kernel_size=(3, 3), strides=(3, 3), padding='same', activation='relu', input_shape=(img_rows, img_cols, channels)))\n",
    "    model.add(Conv2D(64, kernel_size=(3, 3), strides=(3, 3), padding='same', activation='relu'))\n",
    "    model.add(Conv2D(64, kernel_size=(3, 3), strides=(3, 3), padding='same', activation='relu'))\n",
    "    model.add(MaxPooling2D(pool_size=(2, 2)))\n",
    "    model.add(Dropout(0.2))\n",
    "    model.add(Flatten())\n",
    "    model.add(Dense(32))\n",
    "    model.add(Dropout(0.2))\n",
    "    model.add(Dense(32))\n",
    "    model.add(Dropout(0.2))\n",
    "    model.add(Dense(num_classes, activation='softmax'))\n",
    "\n",
    "    model.compile(optimizer='adam', loss='mse', metrics=['accuracy'])\n",
    "    \n",
    "    return model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Model: \"sequential\"\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "conv2d (Conv2D)              (None, 10, 10, 32)        320       \n",
      "_________________________________________________________________\n",
      "conv2d_1 (Conv2D)            (None, 4, 4, 64)          18496     \n",
      "_________________________________________________________________\n",
      "conv2d_2 (Conv2D)            (None, 2, 2, 64)          36928     \n",
      "_________________________________________________________________\n",
      "max_pooling2d (MaxPooling2D) (None, 1, 1, 64)          0         \n",
      "_________________________________________________________________\n",
      "dropout (Dropout)            (None, 1, 1, 64)          0         \n",
      "_________________________________________________________________\n",
      "flatten (Flatten)            (None, 64)                0         \n",
      "_________________________________________________________________\n",
      "dense (Dense)                (None, 32)                2080      \n",
      "_________________________________________________________________\n",
      "dropout_1 (Dropout)          (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 32)                1056      \n",
      "_________________________________________________________________\n",
      "dropout_2 (Dropout)          (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 10)                330       \n",
      "=================================================================\n",
      "Total params: 59,210\n",
      "Trainable params: 59,210\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "# Create and fit model\n",
    "model = create_model()\n",
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 60000 samples, validate on 10000 samples\n",
      "Epoch 1/20\n",
      "60000/60000 [==============================] - 5s 77us/sample - loss: 0.0192 - accuracy: 0.8667 - val_loss: 0.0063 - val_accuracy: 0.9578\n",
      "Epoch 2/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0089 - accuracy: 0.9427 - val_loss: 0.0047 - val_accuracy: 0.9697\n",
      "Epoch 3/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0073 - accuracy: 0.9524 - val_loss: 0.0043 - val_accuracy: 0.9710\n",
      "Epoch 4/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0062 - accuracy: 0.9599 - val_loss: 0.0037 - val_accuracy: 0.9767\n",
      "Epoch 5/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0057 - accuracy: 0.9637 - val_loss: 0.0042 - val_accuracy: 0.9732\n",
      "Epoch 6/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0052 - accuracy: 0.9673 - val_loss: 0.0035 - val_accuracy: 0.9772\n",
      "Epoch 7/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0049 - accuracy: 0.9689 - val_loss: 0.0035 - val_accuracy: 0.9779\n",
      "Epoch 8/20\n",
      "60000/60000 [==============================] - 4s 72us/sample - loss: 0.0048 - accuracy: 0.9701 - val_loss: 0.0033 - val_accuracy: 0.9791\n",
      "Epoch 9/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0043 - accuracy: 0.9723 - val_loss: 0.0037 - val_accuracy: 0.9770\n",
      "Epoch 10/20\n",
      "60000/60000 [==============================] - 4s 71us/sample - loss: 0.0041 - accuracy: 0.9746 - val_loss: 0.0033 - val_accuracy: 0.9797\n",
      "Epoch 11/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0039 - accuracy: 0.9758 - val_loss: 0.0032 - val_accuracy: 0.9794\n",
      "Epoch 12/20\n",
      "60000/60000 [==============================] - 4s 69us/sample - loss: 0.0038 - accuracy: 0.9759 - val_loss: 0.0031 - val_accuracy: 0.9812\n",
      "Epoch 13/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0038 - accuracy: 0.9757 - val_loss: 0.0037 - val_accuracy: 0.9773\n",
      "Epoch 14/20\n",
      "60000/60000 [==============================] - 4s 72us/sample - loss: 0.0034 - accuracy: 0.9783 - val_loss: 0.0030 - val_accuracy: 0.9814\n",
      "Epoch 15/20\n",
      "60000/60000 [==============================] - 4s 69us/sample - loss: 0.0035 - accuracy: 0.9782 - val_loss: 0.0031 - val_accuracy: 0.9808\n",
      "Epoch 16/20\n",
      "60000/60000 [==============================] - 4s 69us/sample - loss: 0.0033 - accuracy: 0.9792 - val_loss: 0.0031 - val_accuracy: 0.9813\n",
      "Epoch 17/20\n",
      "60000/60000 [==============================] - 4s 68us/sample - loss: 0.0032 - accuracy: 0.9803 - val_loss: 0.0030 - val_accuracy: 0.9820\n",
      "Epoch 18/20\n",
      "60000/60000 [==============================] - 4s 70us/sample - loss: 0.0033 - accuracy: 0.9797 - val_loss: 0.0033 - val_accuracy: 0.9796\n",
      "Epoch 19/20\n",
      "60000/60000 [==============================] - 4s 69us/sample - loss: 0.0030 - accuracy: 0.9811 - val_loss: 0.0031 - val_accuracy: 0.9811\n",
      "Epoch 20/20\n",
      "60000/60000 [==============================] - 4s 69us/sample - loss: 0.0031 - accuracy: 0.9807 - val_loss: 0.0030 - val_accuracy: 0.9823\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<tensorflow.python.keras.callbacks.History at 0x7f90904cada0>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.fit(x_train, y_train,\n",
    "          batch_size=32,\n",
    "          epochs=20,\n",
    "          validation_data=(x_test, y_test))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Base accuracy on regular images: [0.002967956433564763, 0.9823]\n"
     ]
    }
   ],
   "source": [
    "# Assess base model accuracy on regular images\n",
    "print(\"Base accuracy on regular images:\", model.evaluate(x=x_test, y=y_test, verbose=0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Function to create adversarial pattern\n",
    "def adversarial_pattern(image, label):\n",
    "    image = tf.cast(image, tf.float32)\n",
    "    \n",
    "    with tf.GradientTape() as tape:\n",
    "        tape.watch(image)\n",
    "        prediction = model(image)\n",
    "        loss = tf.keras.losses.MSE(label, prediction)\n",
    "    \n",
    "    gradient = tape.gradient(loss, image)\n",
    "    \n",
    "    signed_grad = tf.sign(gradient)\n",
    "    \n",
    "    return signed_grad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "five\n",
      "three\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAARHUlEQVR4nO3df5BV5XkH8O9XWH4tgqC4EqRBkbHSCmi2oBMmtUUcpZ1i+sMJnXHI1BYzxcRMnQ6Omana6bSEqBmbZmJJZIKpNbFFK9NBImJmDHEEF0NWEFNQsbBZQUEFVoSFffrHHuii97xnue8595zN8/3M7Ozufe455+Hs/XLuve8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T+/x+YXJbJZhZR/J9H4AnUb2pqPeenEE3+b6v5H5OqdI03rWmGUcF9l2Z05+XEfaXAEwheRHJIQC+AGB1CX18Asnm5I0TkGwGcB2qNxX1agALk58XAniqxF5OU5VpvNOmGUfJ+6706c/NrOFfAOah9x351wF8rYweUvq6GMAvkq9tZfcG4DH0Pq3rRu97G7cAOBfAegA7ADwLYGyFevsBeqf2bkdvsMaX1Nts9D5FbwewJfmaV/a+C/TVkP2mj8uKOKE36EScUNhFnFDYRZxQ2EWcUNhFnFDYRZxQ2EWc+D+XA4ACemUDygAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Create a signle adversarial example\n",
    "image = x_train[0]\n",
    "image_label = y_train[0]\n",
    "perturbations = adversarial_pattern(image.reshape((1, img_rows, img_cols, channels)), image_label).numpy()\n",
    "adversarial = image + perturbations * 0.1\n",
    "\n",
    "print(labels[model.predict(image.reshape((1, img_rows, img_cols, channels))).argmax()])\n",
    "print(labels[model.predict(adversarial).argmax()])\n",
    "\n",
    "if channels == 1:\n",
    "    plt.imshow(adversarial.reshape((img_rows, img_cols)))\n",
    "else:\n",
    "    plt.imshow(adversarial.reshape((img_rows, img_cols, channels)))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# Adversarial data generator\n",
    "def generate_adversarials(batch_size):\n",
    "    while True:\n",
    "        x = []\n",
    "        y = []\n",
    "        for batch in range(batch_size):\n",
    "            N = random.randint(0, 100)\n",
    "\n",
    "            label = y_train[N]\n",
    "            image = x_train[N]\n",
    "            \n",
    "            perturbations = adversarial_pattern(image.reshape((1, img_rows, img_cols, channels)), label).numpy()\n",
    "            \n",
    "            \n",
    "            epsilon = 0.1\n",
    "            adversarial = image + perturbations * epsilon\n",
    "            \n",
    "            x.append(adversarial)\n",
    "            y.append(y_train[N])\n",
    "        \n",
    "        \n",
    "        x = np.asarray(x).reshape((batch_size, img_rows, img_cols, channels))\n",
    "        y = np.asarray(y)\n",
    "        \n",
    "        yield x, y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: three Truth: nine\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAQB0lEQVR4nO3df5BV5X3H8c8XsopFjVAjIqGCCqa2pZBuiJmQjjatJWRaTGfihKap7TjBtppIJpOJY6cN0+kfTqeJyXQMdlOZYJtKnUkc6Yz5QakTk5JaV6EI2kSlYKDIajUVtwQW+faPPaQr7nnOcs997jnL9/2a2dm753vPOQ/n7odz9z7nPI+5uwCc/qY03QAAvUHYgSAIOxAEYQeCIOxAEG/q5c7O6Jvu0848r/wJw4fTG5h+Vncb1JZ9Vzldj0vVtutq8jWro8Yx//GRH+noyLCNV6sVdjNbLukLkqZK+ht3vz31/Glnnqd3LvqD8if86470DhctOuU2TliT+65yuh6Xqm3X1eRrVkeNY/7IjrtKax2/jTezqZLulPQ+SVdIWmVmV3S6PQB51fmbfamkZ9x9t7sflbRR0sruNAtAt9UJ+xxJPxzz875i2euY2WozGzSzwZGR4Rq7A1BH9k/j3X3A3fvdvb+vb3ru3QEoUSfs+yXNHfPzW4tlAFqoTtgflbTAzOab2RmSPiRpU3eaBaDbOu56c/djZnazpG9qtOttvbvv6lrLxpPqkriyZjdLnfWrukqqtp27C6rOvuse1zrbrntccv6+5DxumY55rX52d39Q0oNdaguAjLhcFgiCsAN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3uRyVtlLSygXa0nrs/LOmlkxavlLSheLxBo78sPVfStlZw9wPu/njx+JCkE9OMN3rsEu3qiSbCPkfSD8f8vE/tmu/dJX3LzB4zs9VNN2Ycs9z9QPH4eUmzmmzMOCqn8e6lk6YZb82x62T687r4gO6Nlrn72yW9T9JNxdvVVvLRv8Ha1Hc6oWm8e2WcacZ/oslj1+n053U1Efb9kuaO+fmtxbJWcPf9xfchSferfVNRHzwxg27xfajh9vxEm6bxHm+acbXg2DU5/XkTYX9U0gIzm29mZ0j6kKRNDbTjDcxsevHBicxsuqRr1L6pqDdJur54fL2kBxpsy+u0ZRrvsmnG1fCxa3z6c3fv+ZekFRr9RP5ZSX/cRBtK2nWJpH8vvnY13TZJ92r0bd2IRj/buEHST0vaIulpSf8kaWaL2va3kp6QtEOjwZrdUNuWafQt+g5J24uvFU0fu0S7enLcuFwWCIIP6IAgCDsQBGEHgiDsQBCEHQiCsANBEHYgiP8DyLA50su6+ukAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: three Truth: nine\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAQCUlEQVR4nO3df5BV9XnH8c8jXdAuIiAVKWIQS8Zqi5hZQS3tYI0ZoX9gpi2V6aR0RkvsxEY7ZqaOnan86XQSEls7STFSSZOYyYwxMhNsINQZYlXG1dmuIBqUwQTKDxP8AYTAAk//2INZcc/3LPfcc8+B5/2aYXb3Pvfc8+zd/XDu3u8536+5uwCc/c6puwEAnUHY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lU6k8eD6zwHoOrx4jLfW9mx7rNV6vv2w7kljuxAEIQdCIKwA0EQdiAIwg4EQdiBIAg7EETh9ext3ZnZ25LeGnLTJEk/71gDp6epvTW1L4neWtXO3j7m7r81XKGjYf/Izs163b2ntgYSmtpbU/uS6K1VneqNl/FAEIQdCKLusK+sef8pTe2tqX1J9NaqjvRW69/sADqn7iM7gA4h7EAQtYTdzG4xs9fN7A0zu6+OHvKY2Q4ze8XM+syst+ZeVpnZPjPbPOS2iWa23sy2ZR+HXWOvpt6Wm9mu7LnrM7OFNfU2zcyeMbNXzWyLmd2d3V7rc5foqyPPW8f/ZjezUZJ+IulmSTslvShpibu/2tFGcpjZDkk97l77CRhm9keSDkr6hrv/XnbbP0va7+4PZv9RTnD3f2hIb8slHax7Ge9staIpQ5cZl3SrpL9Wjc9doq/F6sDzVseRfY6kN9x9u7sflfQdSYtq6KPx3H2jpP2n3LxI0urs89Ua/GXpuJzeGsHdd7v7y9nnBySdXGa81ucu0VdH1BH2qZJ+NuTrnWrWeu8uaZ2ZvWRmy+puZhiThyyztUfS5DqbGUbhMt6ddMoy44157lpZ/rws3qD7qHnu/glJCyR9Lnu52kg++DdYk8ZOR7SMd6cMs8z4B+p87lpd/rysOsK+S9K0IV9fkt3WCO6+K/u4T9KTat5S1HtPrqCbfdxXcz8faNIy3sMtM64GPHd1Ln9eR9hflDTTzC4zs9GSbpO0poY+PsLMurM3TmRm3ZI+peYtRb1G0tLs86WSnqqxlw9pyjLeecuMq+bnrvblz9294/8kLdTgO/JvSvrHOnrI6WuGpP/N/m2puzdJj2vwZd2ABt/buF3ShZI2SNom6UeSJjaot//U4NLe/RoM1pSaepunwZfo/ZL6sn8L637uEn115HnjdFkgCN6gA4Ig7EAQhB0IgrADQRB2IAjCDgRB2IEg/h9tECe/lWuoBQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: seven Truth: three\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAQuklEQVR4nO3df4wd1XnG8ee1WYxZg+qNYbvYFthARJ3UNenWmEIRFW1iSCIDfyCMmjqSw9IWqrhN1SKaKkhVEYoakghFtAZcTEOIaAHhqE6Ca0VBCNmwYGdtAwECRrbxD4iha4yBtf32jx2jDeycuZ5z587g8/1I1t6d987M2dl9PPfeM3OOubsAHPsm1N0AAJ1B2IFEEHYgEYQdSARhBxJxXCd3drxN8hPUnf+E7snhDew/0N4GtWvfVbe7yu0XbbtIlb+TInUel6JtxxzXiHa/q/1639+z8WpRYTezhZK+K2mipLvc/dbQ809Qt86zS/KfMHdueIfrho66jS2L2XfV7a5y+0XbLlLl76RIncelaNsxxzWi3et9bW6t9Mt4M5so6XuSLpU0R9JiM5tTdnsAqhXznn2+pJfc/WV3f1/SDyUtak+zALRbTNinS9o25vvt2bLfYGYDZjZoZoMjei9idwBiVP5pvLsvd/d+d+/v0qSqdwcgR0zYd0iaOeb7GdkyAA0UE/anJJ1tZrPM7HhJV0ta1Z5mAWi30l1v7n7QzG6Q9FONdr2tcPctbWvZeBYEujNiu4Dq7EJqsqLjEvqdxG67yWJ+bin8s8dse+iJ3FJUP7u7r5a0OmYbADqDy2WBRBB2IBGEHUgEYQcSQdiBRBB2IBHWydFlT7YeD97iWqfYftMYsf3NVfZ119mfXOdxKVL1cStp/dC/afjtHePez86ZHUgEYQcSQdiBRBB2IBGEHUgEYQcS0dGhpGtVZRdS7L5ju6CafKtozHGvszu0TjG/T88fhpozO5AIwg4kgrADiSDsQCIIO5AIwg4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HLtCuq9SB41bHmX2+pJfc/WV3f1/SDyUtqqEdjefuj0na+6HFiyStzB6v1OgfS8fltK0R3H2nuz+TPd4n6cg047Ueu0C7OqKOsE+XtG3M99vVrPneXdKjZva0mQ3U3Zhx9Lr7zuzxLkm9dTZmHIXTeHfSh6YZb8yxKzP9eSw+oPuoC939M5IulXR99nK1kXz0PViT+k5bmsa7U8aZZvwDdR67stOfx6oj7DskzRzz/YxsWSO4+47s6x5JD6t5U1HvPjKDbvZ1T83t+UCTpvEeb5pxNeDY1Tn9eR1hf0rS2WY2y8yOl3S1pFU1tOMjzKw7++BEZtYt6bNq3lTUqyQtyR4vkfRIjW35DU2ZxjtvmnHVfOxqn/7c3Tv+T9JlGv1E/leS/rGONuS0a7akX2T/ttTdNkn3a/Rl3YhGP9tYKukTktZKelHS/0rqaVDb/lPSJklDGg1WX01tu1CjL9GHJG3M/l1W97ELtKsjx43LZYFE8AEdkAjCDiSCsAOJIOxAIgg7kAjCDiSCsAOJ+H+l6150bbli8wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: three Truth: seven\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAQi0lEQVR4nO3df4xV5Z3H8c8XHGA6FAVRoJStoNSEdFl0Z4Fu2a7i1lWbLbjZmNJNyyZuadK60aRp19g/arJJ426qtclWzbiyYtPFmrYumJBtWZYsbVSW0aUDiIIrWKD8MlD5sQgz8N0/5tAddc5zhvvcc88ZnvcrIXPnfu855zt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KNevu+pC2SetQfrCkV9bZA/W/ReyRtzv7dVvW+C/TVkv3G4bJAIviADkgEYQcSQdiBRBB2IBGEHUgEYQcSQdiBRPwfOIRP40GQOxEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: three Truth: four\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAQKUlEQVR4nO3db4wd1X3G8eexWQNZG7BrsIxjHCCmLUmISTZAGtTSoCLCiwJKQ8MLRFRUp1WogkSUIvoiKG+KKkiaojaRU6w4FSGKFAhWRQKuhYoQwWKhZm3+BDsIih3bGwca8J/A2v71xQ7RxuycWd+5c2fs8/1I1t6dc2fmt7P38dy9Z84cR4QAHPtmtV0AgMEg7EAmCDuQCcIOZIKwA5k4bpA7m+Pj4wQNlz9h+MT0Bvbu729BR6KqtpQ2665S95jXOS5V6h63Jn9nTb5Wa9T9m7f+T29P7PV0bbXCbvtySd+QNFvSv0fE7annn6BhXehLy59w3nnpHT4xdsQ19k1VbSlt1l2l7jGvc1yq1D1uTf7Omnyt1qh7w9i3Stt6fhtve7akf5X0KUnnSrrW9rm9bg9As+r8zX6BpK0R8VJEvC3p+5Ku7E9ZAPqtTtiXSHp1yvfbimW/w/ZK26O2Ryf0Vo3dAaij8U/jI2JVRIxExMiQjm96dwBK1An7dklLp3z/3mIZgA6qE/YnJS23fabtOZI+K2ltf8oC0G89d71FxAHbN0p6SJNdb6sj4tm+VTadixJdEnW7aVLbrqtq2012zdX9uZqsvclj3rQ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mlP29N4F7MVLZ46zbikqyR9Ti0eu0Rd12gAx62NM/sFkrZGxEsR8bak70u6soU6Oi8iHpX02mGLr5S0pni8RpMvloErqa0TImJHRDxdPH5T0jvTjLd67BJ1DUQbYV8i6dUp329Tt+Z7D0kP237K9sq2i5nGoojYUTzeKWlRm8VMo3Ia70E6bJrxzhy7XqY/r4sP6N7t4oj4iKRPSfpC8Xa1k2Lyb7Au9Z3OaBrvQZlmmvHfavPY9Tr9eV1thH27pKVTvn9vsawTImJ78XVc0v3q3lTUu96ZQbf4Ot5yPb/VpWm8p5tmXB04dm1Of95G2J+UtNz2mbbnSPqspLUt1PEutoeLD05ke1jSZereVNRrJV1fPL5e0gMt1vI7ujKNd9k042r52LU+/XlEDPyfpCs0+Yn8zyX9Qxs1lNR1lqRnin/Ptl2bpHs1+bZuQpOfbdwg6fckrZe0RdJ/SVrQodr+Q9ImSWOaDNbilmq7WJNv0cckbSz+XdH2sUvUNZDjxuWyQCb4gA7IBGEHMkHYgUwQdiAThB3IBGEHMkHYgUz8P9G3KeHZoRA/AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: three Truth: nine\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAARIklEQVR4nO3dfYxV5Z0H8O8XGIZxKPJWEYEiKu5KulNKpsBu6cbG1VCaFrtmrSSlbMMu2pVEkm52XTWRbZON2a123Te7YyXC1mqaWAub+IbUrmtVZLA4gLS+UBQmw4uivMnLwPz2jzm4o97znO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bkyerpaS9f4NVqax034t410vFZYZ/0CRx67a5c9jFRH2TgCT+nw/MbmtFMysM/m8F8AjKN9S1HtOr6CbfN5bcD8fKNMy3pWWGUcJjl2Ry58XEfYNAKaSnEJyKIDrAKwpoI+PIdmcvHACks0ArkL5lqJeA2BR8vUiAKsL7OVDyrKMd9oy4yj42BW+/LmZ1f0DwDz0viL/BoBbi+ghpa+LALycfGwtujcAD6L3aV03el/bWAxgDIB1AF4D8BSA0SXq7b8AbAbQgd5gjS+otznofYreAWBT8jGv6GMX6Ksux01vlxVxQi/QiTihsIs4obCLOKGwizihsIs4obCLOKGwizjxf2KLfDcDQAmkAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: five Truth: five\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAPgklEQVR4nO3db4wd1X3G8ecpXRK0jhW7tI5LViQFXsRFjiErQyltaaGBUFUmEkIhSuRWUCfEIKiiKAhehDdIqG2SoogYOcWKnSZEEcHCISgJbCKRiMRiAbMY0xaKbNmW/yRyKmOXwmJ+fbEDWmDvzHrOnTtzfb4fabV359w587vjfTx375mZ44gQgBPf77RdAIDBIOxAJgg7kAnCDmSCsAOZ+N1BbuzkkdF497ve2/sJR18u72D0lP4WdDyqaksxzK+rqvay/lNfd5O/L6l9p+zXhLr/75X/0avTRz1XW1LYbV8m6U5JJ0n6t4i4o+z5737Xe3Xe8s/2fsKvpso3uHz5cdfYN1W1pRjm11VVe1n/qa+7yd+X1L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unpPGIaP0EDNt/LumIpE0RcXax7J8kHYqIO4r/KBdFxBc7Utttko60PY13MVvR0tnTjEu6QtLfqcV9V1LXVRrAfmvjyL5S0gsR8WJEvCrpu5JWtVBH50XEo5IOvW3xKkkbi8cbNfPLMnA9auuEiNgXEU8Wj1+S9MY0463uu5K6BqKNsJ8mafesn/eoW/O9h6Sf2H7C9pq2i5nDklnTbO2XtKTNYuZQOY33IL1tmvHO7Ls605+n4gO6d7owIs6V9DFJa4u3q50UM3+DdWnsdF7TeA/KHNOMv6nNfVd3+vNUbYR9r6SxWT+/v1jWCRGxt/h+UNJmdW8q6gNvzKBbfD/Ycj1v6tI03nNNM64O7Ls2pz9vI+yPSzrL9gdtnyzpE5K2tFDHO9geLT44ke1RSR9V96ai3iJpdfF4taQHWqzlLboyjXevacbV8r5rffrziBj4l6TLNfOJ/H9LurWNGnrU9UeSni6+nm27Nkn3auZt3bRmPtu4RtLvSZqQ9LykRyQt7lBt39LM1N5TmgnW0pZqu1Azb9GnJG0rvi5ve9+V1DWQ/cbpskAm+IAOyARhBzJB2IFMEHYgE4QdyARhBzJB2IFM/D8qny5z9l7jHwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: four Truth: nine\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAQdklEQVR4nO3dcWxV53kG8OcpGEJNU2CkjuuwlFA6SiNCKoukLepY0zQJjUIiTRQ6ZWyN6qRNsnatpkVMWqOtmli30qXtFOQuKDB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Fevt3AM8B6MZgsFpL6m0+Bp+idwPYlv1bWPZjF+irIY+b3i4r4oReoBNxQmEXcUJhF3FCYRdxQmEXcUJhF3FCYRdx4v8ATaVY7j7lS+AAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: nine Truth: four\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAQ6UlEQVR4nO3df5BV5XkH8O9XXBayaFnEIAIKIqRSSzDdkLTaRifWKpkGks44oTMptk43nWiaTNNJrU5HOpPOOPmBTTLGzKpUzBgSZxIrieYHEEdqLMpikZ8VkGKFLCwGDLDhx7I8/WMPdtU971nue997Djzfz8zO3r3PPec8nL1fzt373nNemhlE5Ox3TtkNiEhjKOwiTijsIk4o7CJOKOwiTpzbyI0Nb2qxEc2j8x/QcyS8gpaR9W2oUdsuWnesM3W/xG67SMrfWdG6Y3qP6PvosTdwvLeHg9Wiwk7yRgBfAzAMwINmdk/o8SOaR+MDM/8m/wGr14c3OHPmafc4ZCm3XbTuWGfqfonddpGUv7Oidcf0HtH38+u/lVur+WU8yWEA7gNwE4AZAOaTnFHr+kQkrZi/2WcD2G5mO8zsOIDvAphbn7ZEpN5iwj4BwGsDft6V3fcWJNtJdpLs7O3tidiciMRI/m68mXWYWZuZtTU1taTenIjkiAn7bgCTBvw8MbtPRCooJuxrAEwjOYXkcACfALCsPm2JSL3VPPRmZidI3g7gp+gfeltsZpvq1tlgQsMZH0w4BBSrqLfYIaaU+yV2+TP1d1ammOeD5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CwcrNDTs79g42WlmbaU1EFDV3qraF6DeatWo3vQyXsQJhV3EibLD3lHy9kOq2ltV+wLUW60a0lupf7OLSOOUfWQXkQZR2EWcKCXsJG8k+TLJ7STvKKOHPCR3ktxAch3JzpJ7WUyym+TGAfeNIbmc5Lbs+6Bz7JXU20KSu7N9t47knJJ6m0TyaZKbSW4i+dns/lL3XaCvhuy3hv/NTnIYgK0A/hjALgBrAMw3s80NbSQHyZ0A2sys9A9gkPwjAIcBPGJmV2b3fQnAfjO7J/uPstXM/qEivS0EcLjsabyz2YrGD5xmHMA8ALegxH0X6OtmNGC/lXFknw1gu5ntMLPjAL4LYG4JfVSema0CsP9td88FsCS7vQT9T5aGy+mtEsysy8xezG4fAnBqmvFS912gr4YoI+wTALw24OddqNZ87wbgZyTXkmwvu5lBjDOzruz2HgDjymxmEIXTeDfS26YZr8y+q2X681h6g+6drjGz9wG4CcBt2cvVSrL+v8GqNHY6pGm8G2WQacbfVOa+q3X681hlhH03gEkDfp6Y3VcJZrY7+94N4HFUbyrqvadm0M2+d5fcz5uqNI33YNOMowL7rszpz8sI+xoA00hOITkcwCcALCuhj3cg2ZK9cQKSLQBuQPWmol4GYEF2ewGAJ0rs5S2qMo133jTjKHnflT79uZk1/AvAHPS/I/8KgLvK6CGnr8sAvJR9bSq7NwBL0f+yrhf9723cCuACACsBbAOwAsCYCvX2bQAbAKxHf7DGl9TbNeh/ib4ewLrsa07Z+y7QV0P2mz4uK+KE3qATcUJhF3FCYRdxQmEXcUJhF3FCYRdxQmEXceL/AFtkSWi+Lz0VAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: nine Truth: zero\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfA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Sm0jem9xf6L5z+qrLfqv73+wkewH4JYDbAewCsAbANDPbXNdGUpDcAaDFzAr/AAbJjwM4BOBpM7smue9rAPab2fzkP8pBZvb3JeltHoBDRU/jncxWNKz7NOMApgD4SxS475y+pqIO+62II/s4AG+a2XYzOw7g+wAmF9BH6ZnZSwD2n3b3ZACLk9uL0fXLUncpvZWCmbWZ2WvJ7XcBvD/NeKH7zumrLooI+3AAb3f7eRfKNd+7AfgpybUkZxXdTA+GmllbcnsPgKFFNtODzGm86+m0acZLs++qmf48lN6g+7Bbzex6AJ8GcE/ycrWUrOtvsDKNnVY0jXe99DDN+AeK3HfVTn8eqoiw7wbQ3O3nEcl9pWBmu5Pv7QCeR/mmot77/gy6yff2gvv5QJmm8e5pmnGUYN8VOf15EWFfA2AUyZEk+wC4G8CyAvr4EJKNyRsnINkI4FMo31TUywDMSG7PALC0wF5OUZZpvNOmGUfB+67w6c/NrO5fAO5A1zvyvwLwD0X0kNLX5QBeT742Fd0bgGfQ9bKuA13vbcwEMBjASgDbAPw3gKYS9fYdABsArEdXsIYV1Nut6HqJvh7AuuTrjqL3ndNXXfabPi4rEgm9QScSCYVdJBIKu0gkFHaRSCjsIpFQ2EUiobCLROL/AaxHesbaPqsGAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: eight Truth: zero\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAQ/0lEQVR4nO3df3BV5ZkH8O9XGn4YQEkFTAOuBVGHbSndzRL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ebpaSjb6N1iZeqfjWsa7XiosM/6eIh+7apc/j1VE2HsAzB/z/bzktlIws57kcx+AR1C+pah7T6ygm3zuK3g87ynTMt6VlhlHCR67Ipc/LyLszwJYRPKTJCcDuArAlgLG8SEkG5MXTkCyEcClKN9S1FsArEu+Xgfg0QLH8gFlWcY7bZlxFPzYFb78uZnV/QPAaoy+Iv8ygH8tYgwp41oA4PfJx+6ixwbgQYw+rRvC6GsbXwPwcQAdALoBPA6gqURj+y+MLu3dhdFgNRc0thUYfYreBWBn8rG66McuMK66PG56u6yIE3qBTsQJhV3ECYVdxAmFXcQJhV3ECYVdxAmFXcSJ/wcwOWtYi68v5AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prediction: two Truth: one\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAPpUlEQVR4nO3dbYwd1X3H8d/PZnmIAWHzsLGIVQxyG6HGOM3KhEArGloCqKnJCwi8ACKhmqohImqkBpEX4V1RVYiQWxE5BcUkKShSQnFV8uBakawogrJQ4wdoYiCmYBkc6iBsxzF++PfFDmSBvWeu77lzZ9bn+5FWuzvnzsxfs/557r3nnnMcEQJw7JvTdgEARoOwA4Ug7EAhCDtQCMIOFOK4UZ7seJ8QJ2pe7wfMOyl9gH37h1vQ0Zw7pa6unGPnHj+3ttxrnlNbzrFzzdLafqt9eisOeKa2rLDbvkLSvZLmSvqXiLgr9fgTNU8X+rLeD1i6NH3CxzcddY19qzt3Sl1dOcfOPX5ubb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7pFUlPSro+Ip4daSE92N4uaSIiWv8Ahu0/kbRX0oMR8YfVtn+QtDsi7qr+o5wfEV/uSG13Strb9jLe1WpFC6cvMy7pakmfU4vXLlHXtRrBdWvjzr5c0vMR8WJEvCXpYUkrWqij8yJig6Td79m8QtKa6uc1mvrHMnI9auuEiNgZEU9XP++R9PYy461eu0RdI9FG2M+W9PK0319Rt9Z7D0k/tv2U7ZVtFzOD8YjYWf38qqTxNouZQe0y3qP0nmXGO3PtBln+PBdv0L3fJRHxR5KulPT56ulqJ8XUa7Au9Z32tYz3qMywzPg72rx2gy5/nquNsO+QtGja7x+qtnVCROyovu+S9Ii6txT1a2+voFt939VyPe/o0jLeMy0zrg5cuzaXP28j7E9KWmJ7se3jJV0naW0LdbyP7XnVGyeyPU/S5ereUtRrJd1U/XyTpEdbrOVdurKMd69lxtXytWt9+fOIGPmXpKs09Y78C5K+0kYNPeo6V9Iz1dfWtmuT9JCmntYd1NR7GzdLOl3SeknbJP2npAUdqu1bkjZL2qSpYC1sqbZLNPUUfZOkjdXXVW1fu0RdI7lufFwWKARv0AGFIOxAIQg7UAjCDhSCsAOFIOxAIQg7UIj/ByC6J06RN4UiAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Generate and visualize 12 adversarial images\n",
    "adversarials, correct_labels = next(generate_adversarials(12))\n",
    "for adversarial, correct_label in zip(adversarials, correct_labels):\n",
    "    print('Prediction:', labels[model.predict(adversarial.reshape((1, img_rows, img_cols, channels))).argmax()], 'Truth:', labels[correct_label.argmax()])\n",
    "    if channels == 1:\n",
    "        plt.imshow(adversarial.reshape(img_rows, img_cols))\n",
    "    else:\n",
    "        plt.imshow(adversarial)\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# Generate adversarial data\n",
    "# x_adversarial, y_adversarial = np.load(\"x_adv_10k.npy\"), np.load(\"y_adv_10k.npy\")\n",
    "x_adversarial_train, y_adversarial_train = next(generate_adversarials(20000))\n",
    "x_adversarial_test, y_adversarial_test = next(generate_adversarials(10000))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Base accuracy on adversarial images: [0.13803682882785798, 0.2012]\n"
     ]
    }
   ],
   "source": [
    "# Assess base model on adversarial data\n",
    "print(\"Base accuracy on adversarial images:\", model.evaluate(x=x_adversarial_test, y=y_adversarial_test, verbose=0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 20000 samples, validate on 10000 samples\n",
      "Epoch 1/10\n",
      "20000/20000 [==============================] - 2s 80us/sample - loss: 0.0068 - accuracy: 0.9623 - val_loss: 0.0080 - val_accuracy: 0.9553\n",
      "Epoch 2/10\n",
      "20000/20000 [==============================] - 2s 87us/sample - loss: 0.0021 - accuracy: 0.9891 - val_loss: 0.0093 - val_accuracy: 0.9486\n",
      "Epoch 3/10\n",
      "20000/20000 [==============================] - 2s 89us/sample - loss: 0.0021 - accuracy: 0.9890 - val_loss: 0.0096 - val_accuracy: 0.9477\n",
      "Epoch 4/10\n",
      "20000/20000 [==============================] - 2s 90us/sample - loss: 0.0021 - accuracy: 0.9895 - val_loss: 0.0091 - val_accuracy: 0.9501\n",
      "Epoch 5/10\n",
      "20000/20000 [==============================] - 2s 84us/sample - loss: 0.0015 - accuracy: 0.9925 - val_loss: 0.0096 - val_accuracy: 0.9478\n",
      "Epoch 6/10\n",
      "20000/20000 [==============================] - 2s 82us/sample - loss: 1.9439e-04 - accuracy: 0.9990 - val_loss: 0.0123 - val_accuracy: 0.9329\n",
      "Epoch 7/10\n",
      "20000/20000 [==============================] - 2s 81us/sample - loss: 1.1688e-04 - accuracy: 0.9994 - val_loss: 0.0110 - val_accuracy: 0.9401\n",
      "Epoch 8/10\n",
      "20000/20000 [==============================] - 2s 81us/sample - loss: 1.7400e-04 - accuracy: 0.9990 - val_loss: 0.0116 - val_accuracy: 0.9370\n",
      "Epoch 9/10\n",
      "20000/20000 [==============================] - 2s 80us/sample - loss: 9.4368e-05 - accuracy: 0.9995 - val_loss: 0.0110 - val_accuracy: 0.9397\n",
      "Epoch 10/10\n",
      "20000/20000 [==============================] - 2s 81us/sample - loss: 5.1144e-05 - accuracy: 0.9997 - val_loss: 0.0112 - val_accuracy: 0.9384\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<tensorflow.python.keras.callbacks.History at 0x7f906c1b7358>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Learn from adversarial data\n",
    "model.fit(x_adversarial_train, y_adversarial_train,\n",
    "          batch_size=32,\n",
    "          epochs=10,\n",
    "          validation_data=(x_test, y_test))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Defended accuracy on adversarial images: [3.020054845218167e-25, 1.0]\n",
      "Defended accuracy on regular images: [0.011241577985890636, 0.9384]\n"
     ]
    }
   ],
   "source": [
    "# Assess defended model on adversarial data\n",
    "print(\"Defended accuracy on adversarial images:\", model.evaluate(x=x_adversarial_test, y=y_adversarial_test, verbose=0))\n",
    "\n",
    "# Assess defended model on regular data\n",
    "print(\"Defended accuracy on regular images:\", model.evaluate(x=x_test, y=y_test, verbose=0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Defended accuracy on adversarial images: [0.05324754492491484, 0.7229]\n"
     ]
    }
   ],
   "source": [
    "x_adversarial_test, y_adversarial_test = next(generate_adversarials(10000))\n",
    "print(\"Defended accuracy on adversarial images:\", model.evaluate(x=x_adversarial_test, y=y_adversarial_test, verbose=0))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
